<!--!
This file is a part of MediaDrop (https://www.mediadrop.video),
Copyright 2009-2018 MediaDrop contributors
For the exact contribution history, see the git revision log.
The source code contained in this file is licensed under the GPLv3 or
(at your option) any later version.
See LICENSE.txt in the main project directory, for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      py:strip="">
<body py:match="body"
      py:with="cat_class=c.category and 'mcore-cat-%s' % c.category.slug or 'mcore-cats'"
      py:attrs="h.append_class_attr(select('@*'), cat_class + ' nav-categories-on')"
>
	<div class="mediadrop-content clearfix">
		<h2 id="category-breadcrumb" class="head-super" py:choose="">
			<py:when test="c.category">
				<a class="uppercase underline-hover" href="${h.url_for(action='index', slug=None, order=None)}">Categories</a>
				<py:for each="cat in c.breadcrumb">
					&gt; <a class="underline-hover" href="${h.url_for(action='index', slug=cat.slug, order=None)}">${cat.name}</a>
				</py:for>
			</py:when>
			<py:otherwise><span class="uppercase mcore-heading">Choose a Category:</span></py:otherwise>
		</h2>
		<div id="categories-bar">
			<ul py:def="cat_list(cats, crumb, depth=0)" class="${depth >= 1 and 'sub' or ''}category-list">
				<li py:for="cat in cats"
				    py:if="tmpl_context.category_counts.get(cat.id, 0)"
				    py:with="is_ancestor = crumb and crumb[0] == cat;
					         selected = c.category == cat">
					<a class="underline-hover ${is_ancestor and 'ancestor' or ''} ${selected  and 'category-selected' or ''}" href="${h.url_for(action='index', slug=cat.slug, order=None)}">${cat.name}</a>
					<ul py:if="is_ancestor" py:replace="cat_list(cat.children, crumb[1:], depth + 1)" />
				</li>
			</ul>
			${cat_list(c.categories, c.breadcrumb)}
		</div>
		<div id="category-content" class="clearfix" py:content="select('*|text()')">Content is injected here</div>
	</div>
	<div py:if="c.paginators" class="mediadrop-content clear clearfix">
		<div py:replace="pager(c.paginators.media)" />
	</div>
</body>
</html>
